<style>
    .layui-form-label{width: 120px!important;}
</style>
<form class="layui-form" action="">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">人员名称</label>
            <div class="layui-input-inline">
                <input type="tel" name="user_name" lay-verify="required" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">身份证号</label>
            <div class="layui-input-inline">
                <input type="text" name="card_num" autocomplete="off"  class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">增(减)时间</label>
            <div class="layui-input-inline">
                <input type="text" name="year"  id="year"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">实际发放月份</label>
            <div class="layui-input-inline">
                <input type="text" name="month"  autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">年终一资性奖金</label>
            <div class="layui-input-inline">
                <input type="text" name="year_bonus"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">全国文明城市奖</label>
            <div class="layui-input-inline">
                <input type="text" name="civilization_bonus"  autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">年度目标考核奖</label>
            <div class="layui-input-inline">
                <input type="text" name="year_assessment_of_award"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">平时考核奖</label>
            <div class="layui-input-inline">
                <input type="text" name="usual_assessment_of_award"  autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">取暖费</label>
            <div class="layui-input-inline">
                <input type="text" name="heating_fee"  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">平安建设奖</label>
            <div class="layui-input-inline">
                <input type="text" name="construction_prize"  autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-inline">
                <input type="text" name="remark"  autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn" lay-submit="" lay-filter="addData">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
<script>
    layui.use(['form','laydate'], function(){
        var form = layui.form
            , laydate = layui.laydate
            , layer = layui.layer;
        //日期
//        laydate.render({
//            elem: '#reasons_time'
//            , type: 'month'
//        });
        //监听提交
        form.on('submit(addData)', function(data){
            $.ajax({
                url: '{:url("/finance/Bonus/ajaxAdd")}',
                type: 'post',
                dataType: 'json',
                data:{addData:data.field},
                beforeSend: function () {
                    layer.load(2);
                },
                complete: function () {
                    layer.closeAll('loading');
                },
                success: function (res) {
                    if(res.code == 1){
                        layer.msg('添加成功', {icon: 1});
                        return false;
                    }
                    layer.alert(res.msg, {icon: 2}); return false;
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    layer.alert('网络失败，请联系管理员', {icon: 2});
                }
            });
            return false;
        });
    });
</script>